﻿using Model.BusinessModel;
using Model.BusinessModel.InPut;
using Model.BusinessModel.OutPut;
using Model.DomainModel;
using Model.OverallAtuhModel;
using Utility;

namespace DomainService.IService
{
    /// <summary>
    /// 流程申请服务接口
    /// </summary>
    public interface IFlowApplyService
    {
        /// <summary>
        /// 新增流程申请数据
        /// </summary>
        /// <param name="flowApply">实体模型</param>
        ReceiveStatus Insert(FlowApply flowApply);

        /// <summary>
        /// 更新流程申请信息
        /// </summary>
        /// <param name="flowApply">实体模型</param>
        /// <returns></returns>
        ReceiveStatus Update(FlowApply flowApply);

        /// <summary>
        /// 获取所有流程申请
        /// </summary>
        /// <param name="pageResultModel">分页参数模型</param>
        /// <returns></returns>
        PageResultModel<FlowApplyOutPut> GetAllFlowApply(FlowApplyInput pageResultModel);

        /// <summary>
        /// 获取等待审批流程
        /// </summary>
        /// <param name="pageResultModel">分页模型</param>
        /// <returns></returns>
        PageResultModel<WaitApprovalFlowOutPut> GetWaitApprovalFlow(FlowApplyInput pageResultModel);

        /// <summary>
        /// 获取已审核审批流程
        /// </summary>
        /// <param name="pageResultModel">分页模型</param>
        /// <returns></returns>
        PageResultModel<AuditedApprovalFlowOutPut> GetAuditedApprovalFlow(FlowApplyInput pageResultModel);

        /// <summary>
        /// 获取抄送流程
        /// </summary>
        /// <param name="pageResultModel">分页模型</param>
        /// <returns></returns>
        PageResultModel<CarbonCopyFlowOutPut> GetCarbonCopyFlow(FlowApplyInput pageResultModel);

        /// <summary>
        /// 根据申请id获取数据
        /// </summary>
        /// <param name="flowApplyId">主键</param>
        /// <returns></returns>
        ReceiveStatus<FlowApplyExtendOutPut> GetFlowApplyByApplyId(string flowApplyId);

        /// <summary>
        /// 获取申请当前节点前的所有节点数据
        /// </summary>
        /// <param name="flowApplyId">流程申请id</param>
        /// <returns></returns>
        ReceiveStatus<List<SelectOutPut>> GetExamineNodeSelectData(string flowApplyId);

        /// <summary>
        /// 获取已审核节点数据
        /// </summary>
        /// <param name="flowApplyId"></param>
        /// <returns></returns>
        ReceiveStatus<List<FlowApplyRecord>> GetExamineNodeData(string flowApplyId);

        /// <summary>
        /// 更新发布状态
        /// </summary>
        /// <param name="flowApplyId">主键</param>
        /// <param name="isPublish">发布状态</param>
        /// <returns></returns>
        ReceiveStatus UpdateIsPublish(string flowApplyId, bool isPublish);

        /// <summary>
        /// 更新流程状态
        /// </summary>
        /// <param name="flowApplyId">流程id</param>
        /// <param name="flowApplyState">流程状态</param>
        /// <returns></returns>
        ReceiveStatus UpdateFlowApplyState(string flowApplyId, int flowApplyState);

        /// <summary>
        /// 流程申请审核
        /// </summary>
        /// <param name="flowApplyExamineInput">审核信息</param>
        /// <param name="loginResult">登录人员信息</param>
        /// <returns></returns>
        ReceiveStatus FlowApplyExamine(FlowApplyExamineInput flowApplyExamineInput, LoginOutPut loginResult);
    }
}
